package com.chb.asserts;

import com.chb.enums.IResponseEnum;

import java.text.MessageFormat;

/**
 * @description:
 * @author: CHB
 * @create: 2022-03-01 09:57
 **/
public interface BusinessExceptionAssert extends IResponseEnum,ExceptionAssert {

    @Override
    default BusinessException newException(Object... args) {

        String msg = MessageFormat.format(this.getMessage(), args);
        return new BusinessException(this, args, msg);

    }

    @Override
    default BusinessException newException(Throwable t, Object... args) {

        String msg = MessageFormat.format(this.getMessage(), args);

        return new BusinessException(this, args, msg, t);
    }
}
